﻿
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>管理员登录</title>
    <link href="/Content/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/Content/css/AdminLTE.min.css" rel="stylesheet" />
    <link href="/Content/css/_all-skins.min.css" rel="stylesheet" />
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
    
</head>
<body class="hold-transition login-page">

    <div class="login-box">
        <div class="login-logo">
            <b>Admin</b>LTE
        </div>
        <!-- /.login-logo -->
        <div class="login-box-body">
            <p class="login-box-msg">管理员登录</p>

            <form action="" method="post" id="f1">
                <div class="form-group has-feedback">
                    <input type="email" name="loginName" class="form-control" placeholder="Email" required="required">
                    <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
                </div>
                <div class="form-group has-feedback">
                    <input type="password" class="form-control" placeholder="Password" name="password" required="required">
                    <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                </div>
                <div class="row">
                    <div class="col-xs-8">
                        <a href="#">忘记密码</a>
                    </div>
                    <!-- /.col -->
                    <div class="col-xs-4">
                        <button type="button" class="btn btn-primary btn-block btn-flat">登录</button>
                    </div>
                    <!-- /.col -->
                </div>
            </form>
        </div>
    </div>
    <script src="/Content/js/jquery-3.1.1.min.js"></script>
    <script src="/Content/js/bootstrap.min.js"></script>
    <script src="/Content/js/app.min.js"></script>
    <script src="/Content/js/vue.min.js"></script>
    <script src="/Content/js/ui.js"></script>
    <script>
        let returnUrl = ("@Html.Raw(ViewBag.ReturnUrl)" || "/admin/home");
        $(function() {
            $("button").click(function () {
                let f = document.getElementById("f1");
                let v = $.ui.validate(f);
                if (v) {
                    let d = $.ui.formToJson(f);
                    $.post("/admin/account/login", d,
                        function(res) {
                            console.log(res);
                            if (res.code> 0) {
                                location.href = returnUrl;
                            }
                        });
                    
                }
                
                 
            });
        });
    </script>

</body>
</html>
